/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rhythm.base;

/**
 *
 * @author mlee
 */
public class Objects {

    /**
     * Checks if the two given <code>Object</code>s are equal.  If
     * both of the given <code>Object</code>s are <code>null</code> then
     * this method will always return true.  Otherwise the default equals
     * check will be a.equals(b)
     * <pre>
     * equal(null, null)    = true
     * </pre>
     * @param a nullable
     * @param b nullable
     * @return  true if the a == b or a is not null and  a.equals(b) is true
     */
    public static boolean equal(Object a,  Object b) {
        return a == b || (a != null && a.equals(b));
    }
}
